import { axios } from '@/utils/request'

const api = {
  list: '/aggregate-qrcode/qrcode-list',
  add: '/aggregate-qrcode/create-url',
  code: '/aggregate-qrcode/qrcode-create',
  deleteCode: '/aggregate-qrcode/del-url',
  bandStore: '/aggregate-qrcode/bind-qrcode',
  bindQrcodeOnline: '/aggregate-qrcode/bind-qrcode-online'
}

export default api

export function add(parameter) {
  return axios({
    url: api.add,
    method: 'post',
    data: parameter
  })
}

export function list(parameter) {
  return axios({
    url: api.list,
    method: 'get',
    params: parameter
  })
}

export function code(parameter) {
  return axios({
    url: api.code,
    method: 'post',
    data: parameter
  })
}

export function deleteCode(parameter) {
  return axios({
    url: api.deleteCode,
    method: 'post',
    data: parameter
  })
}

export function bandStore(parameter) {
  return axios({
    url: api.bandStore,
    method: 'post',
    data: parameter
  })
}

export function bindQrcodeOnline(data) {
  return axios({
    url: api.bindQrcodeOnline,
    method: 'post',
    data
  })
}
